package demo.practice.competition;

import java.util.HashSet;
import java.util.Set;

public class Sbarr {


    public int maximumUniqueSubarray(int[] nums) {
        Set<Integer> s= new HashSet<>();
        for(int i=1;i<nums.length;i++){
            s.add(nums[i]);
        }

        int sum= s.stream().mapToInt(i -> i).sum();
        return sum;
    }

}
